home *** CD-ROM | disk | FTP | other *** search
/ PC World Interactive 7 / PC World Interactive 7.iso / bb2000 / files / BlueGame.dxr / 00174.ls < prev    next >
Encoding:
Text File  |  1998-02-20  |  4.5 KB  |  145 lines

  1. global gMasterObj, gCarObj, gGamesMasterObj, myGridArray, noWayBubList, locateBubList, policeBubList, jailBubList, BLOCKWIDTH, BLOCKHEIGHT, RADARSPRITES, BANDSPRITES, CARSPRITE, POLICESPRITES, BUBBLESPRITES, CURSORINDEX, COUNTDOWNSTRIP, LIFESPRITE
  2.  
  3. on startMovie
  4.   autoUnloadMovie(gMasterObj)
  5.   set the actorList to []
  6.   set noWayBubList to []
  7.   set locateBubList to []
  8.   set policeBubList to []
  9.   set jailBubList to []
  10.   set BLOCKWIDTH to 40
  11.   set BLOCKHEIGHT to 40
  12.   set RADARSPRITES to 2
  13.   set BANDSPRITES to 17
  14.   set CARSPRITE to 30
  15.   set POLICESPRITES to 25
  16.   set BUBBLESPRITES to 32
  17.   set LIFESPRITE to 37
  18.   set COUNTDOWNSTRIP to 38
  19.   set CURSORINDEX to the memberNum of member "startCursor"
  20.   set nENDx to [0, 0, 1, 0]
  21.   set eENDx to [0, 0, 0, 1]
  22.   set sENDx to [1, 0, 0, 0]
  23.   set wENDx to [0, 1, 0, 0]
  24.   set nwCRN to [0, 1, 1, 0]
  25.   set neCRN to [0, 0, 1, 1]
  26.   set seCRN to [1, 0, 0, 1]
  27.   set swCRN to [1, 1, 0, 0]
  28.   set nWALL to [0, 1, 1, 1]
  29.   set eWALL to [1, 0, 1, 1]
  30.   set sWALL to [1, 1, 0, 1]
  31.   set wWALL to [1, 1, 1, 0]
  32.   set nsCOR to [1, 0, 1, 0]
  33.   set ewCOR to [0, 1, 0, 1]
  34.   set OPENx to [1, 1, 1, 1]
  35.   set SHUTx to [0, 0, 0, 0]
  36.   set r01 to [SHUTx, SHUTx, nENDx, SHUTx, nENDx, SHUTx, nENDx, SHUTx, nENDx, SHUTx, nENDx, SHUTx, nENDx, SHUTx]
  37.   set r02 to [SHUTx, wENDx, OPENx, ewCOR, sWALL, ewCOR, sWALL, nWALL, sWALL, nWALL, sWALL, ewCOR, OPENx, eENDx]
  38.   set r03 to [SHUTx, SHUTx, nsCOR, SHUTx, SHUTx, SHUTx, SHUTx, nsCOR, SHUTx, nsCOR, SHUTx, SHUTx, nsCOR, SHUTx]
  39.   set r04 to [SHUTx, nwCRN, sWALL, ewCOR, ewCOR, nWALL, ewCOR, OPENx, ewCOR, sWALL, ewCOR, ewCOR, OPENx, eENDx]
  40.   set r05 to [wENDx, eWALL, SHUTx, SHUTx, SHUTx, nsCOR, SHUTx, nsCOR, SHUTx, SHUTx, SHUTx, SHUTx, nsCOR, SHUTx]
  41.   set r06 to [SHUTx, nsCOR, SHUTx, nENDx, SHUTx, nsCOR, SHUTx, nsCOR, SHUTx, SHUTx, nENDx, SHUTx, wWALL, eENDx]
  42.   set r07 to [wENDx, eWALL, SHUTx, wWALL, ewCOR, OPENx, ewCOR, OPENx, ewCOR, nWALL, sWALL, ewCOR, eWALL, SHUTx]
  43.   set r08 to [SHUTx, wWALL, ewCOR, eWALL, SHUTx, nsCOR, SHUTx, sENDx, SHUTx, nsCOR, SHUTx, SHUTx, sENDx, SHUTx]
  44.   set r09 to [SHUTx, sENDx, SHUTx, sENDx, SHUTx, sENDx, SHUTx, sENDx, SHUTx, swCRN, eENDx, SHUTx, sENDx, SHUTx]
  45.   set myGridArray to [r01, r02, r03, r04, r05, r06, r07, r08, r09]
  46. end
  47.  
  48. on setUpGame
  49.   set gGamesMasterObj to new(script "gamesMasterScript")
  50.   init(gGamesMasterObj, [50.30000000000000426, 28.70000000000000284, 16.40000000000000213, 9.40000000000000036, 5.40000000000000036, 3.10000000000000009, 1.80000000000000004, 1], pickRandamLocs())
  51.   toggleGamePuppets(1)
  52.   gameReset()
  53. end
  54.  
  55. on gameReset
  56.   killLastGame(1)
  57.   set gCarObj to new(script "carScript")
  58.   init(gCarObj, 8, 9, CARSPRITE, 5)
  59.   checkCar(gCarObj, 1)
  60.   startTimer()
  61. end
  62.  
  63. on toggleGamePuppets puppetState
  64.   puppetSprite(COUNTDOWNSTRIP, puppetState)
  65.   puppetSprite(LIFESPRITE, puppetState)
  66.   repeat with i = RADARSPRITES to RADARSPRITES + 14
  67.     puppetSprite(i, puppetState)
  68.   end repeat
  69.   repeat with i = BANDSPRITES to BANDSPRITES + 7
  70.     puppetSprite(i, puppetState)
  71.   end repeat
  72. end
  73.  
  74. on killLastGame killCar
  75.   if not killCar then
  76.     if count(the actorList) > 2 then
  77.       set howMany to count(the actorList)
  78.       repeat with i = 3 to howMany
  79.         destroy(getAt(the actorList, 3))
  80.       end repeat
  81.     end if
  82.   else
  83.     if count(the actorList) > 1 then
  84.       set howMany to count(the actorList)
  85.       repeat with i = 2 to howMany
  86.         destroy(getAt(the actorList, 2))
  87.       end repeat
  88.     end if
  89.     set gCarObj to 0
  90.   end if
  91. end
  92.  
  93. on pickRandamLocs
  94.   set mysteryLocList to []
  95.   set bigList to [[3, 1], [5, 1], [7, 1], [9, 1], [11, 1], [13, 1], [2, 2], [14, 2], [14, 4], [1, 5], [4, 6], [11, 6], [14, 6], [1, 7], [2, 9], [4, 9], [6, 9], [11, 9]]
  96.   repeat with i = 1 to 8
  97.     set newLoc to getAt(bigList, random(count(bigList)))
  98.     append(mysteryLocList, newLoc)
  99.     deleteAt(bigList, getOne(bigList, newLoc))
  100.   end repeat
  101.   return mysteryLocList
  102. end
  103.  
  104. on keyDown
  105.   if the actorList <> [] then
  106.     set the keyPressed of gGamesMasterObj to the keyCode
  107.   end if
  108. end
  109.  
  110. on keyUp
  111.   if the actorList <> [] then
  112.     set the keyPressed of gGamesMasterObj to 0
  113.   end if
  114. end
  115.  
  116. on customWait flag, seconds
  117.   set the timer to the timer - (seconds * 60)
  118.   set theTime to the timer
  119.   repeat while (the timer - theTime) < (seconds * 60)
  120.     if flag then
  121.       updateStage()
  122.     end if
  123.   end repeat
  124. end
  125.  
  126. on toggleFreezeCar state
  127.   set the freezedCar of gCarObj to state
  128. end
  129.  
  130. on clearedPolice
  131.   if the policeCounter of gGamesMasterObj = 0 then
  132.     return 1
  133.   end if
  134.   return 0
  135. end
  136.  
  137. on cleanMeUp
  138.   set the actorList to []
  139.   go(1, "BlueMenu")
  140. end
  141.  
  142. on stopMovie
  143.   set the actorList to []
  144. end
  145.